import request from "@/utils/request";

const typePre = "/system/tenant/type/";
const pre = "/system/tenant";

export function typePage(params: any) {
  return request.post({ url: typePre + "/page", params });
}

export function typeList(params: any) {
  return request.post({ url: typePre + "/list", params });
}

/**
 * 添加租户类型
 * @param params
 * @returns
 */
export function typeAdd(params: any) {
  return request.post({ url: typePre + "/add", params });
}

export function typeEdit(params: any) {
  return request.post({ url: typePre + "/edit", params });
}
/**
 * 授权租户类型
 * @param params
 * @returns
 */
export function typeAuth(params: any) {
  return request.post({
    url: typePre + "/auth/" + params.typeId,
    params: params.menuIds,
  });
}

/**
 * 添加租户
 * @param params
 * @returns
 */
export function addTenant(params: any) {
  return request.post({ url: pre + "/add", params });
}
export function editTenant(params: any) {
  return request.post({ url: pre + "/edit", params });
}

export function delTenant(params: any) {
  return request.post({ url: pre + "/del", params });
}
export function pageTenant(params: any) {
  return request.post({ url: pre + "/page", params });
}
